﻿/***************
 * Copyright 2009 (C) 
 * Timur Fanshteyn
 * Blog: http://blog.tfanshteyn.com
 * ************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Coherence.Linq;
using System.Linq.Expressions;
using Tangosol.Util.Extractor;
using Tangosol.Net;

namespace Coherence.Contrib
{
    public class MetadataCoherenceQueryProvider : CoherenceQueryProvider
    {
        public MetadataCoherenceQueryProvider()
            : base(null, new CoherenceQueryTranslator())
	    {
	    }

        public MetadataCoherenceQueryProvider(INamedCache cache)
            : base(cache, new CoherenceQueryTranslator())
        {
        }

        protected override Tangosol.Util.IFilter GenerateFilter(TranslateResult result)
        {
            return new MetadataFilterBuilder().Build(result.Where);
        }
    }
}
